// EcoModeler - C# Edition :: Version 9.16 build 3301
using System;
using System.ComponentModel;
using System.Collections;
using System.Collections.Generic;
using Eco.Services;
using Eco.ObjectRepresentation;
using Eco.ObjectImplementation;
using Eco.UmlRt;
using Eco.UmlCodeAttributes;
using Eco.Subscription;

namespace TTServer
{
	#region MM_ECO_Generated
	#region Attributes
	[UmlElement(Id="{56103147-2a49-479b-8334-1143850fec6c}")]
	#endregion

	#endregion
	public class Rahmenterminplan: object, ILoopBack
	{
		#region MM_ECO AutoGenerated ECO code

		protected IContent eco_Content;

		IObject IObjectProvider.AsIObject()
		{
			return this.eco_Content.AsIObject();
		}

		public IObjectInstance AsIObject()
		{
			return this.eco_Content.AsIObject();
		}

		public struct Eco_LoopbackIndices
		{
			public const int Eco_FirstMember = 0;
			public const int Eco_MemberCount = (Eco_FirstMember + 5);
			public const int Klasse_MemberIndex = Eco_FirstMember + 0;
			public const int Name_MemberIndex = Eco_FirstMember + 1;
			public const int Saison_MemberIndex = Eco_FirstMember + 2;
			public const int Spieltag_MemberIndex = Eco_FirstMember + 3;
			public const int Wunsch_MemberIndex = Eco_FirstMember + 4;
		}

		public virtual object get_MemberByIndex(int index)
		{
			switch (index)
			{
				default: throw new System.IndexOutOfRangeException();
			}
		}

		public virtual void set_MemberByIndex(int index, object value)
		{
			switch (index)
			{
				default: throw new System.IndexOutOfRangeException();
			}
		}

		protected void Initialize(IEcoServiceProvider serviceProvider)
		{
			if ((this.eco_Content == null))
			{
				IInternalObjectContentFactory factory = ((IInternalObjectContentFactory)(serviceProvider.GetEcoService(typeof(IInternalObjectContentFactory))));
				this.eco_Content = factory.CreateContent(this);
				this.eco_Content.LoopbackValid();
			}
		}

		protected void Deinitialize(IEcoServiceProvider serviceProvider)
		{
			if ((this.eco_Content != null))
			{
				IInternalObjectContentFactory factory = ((IInternalObjectContentFactory)(serviceProvider.GetEcoService(typeof(IInternalObjectContentFactory))));
				factory.CreateContentFailed(this.eco_Content, this);
				this.eco_Content = null;
			}
		}
		#endregion

		#region MM_ECO Model owned attributes
		//Note: Do not remove any property within this region, nor change its signature

		#region MM_ECO_Generated
		[UmlElement("AssociationEnd", Index=(Rahmenterminplan.Eco_LoopbackIndices.Saison_MemberIndex), Id="{79eb2f2f-6121-498a-a1e6-5a86336f37df}")]
		[UmlMetaAttribute("association", typeof(TTServerPackage.SaisonRahmenterminplan), Index=0)]
		[UmlMetaAttribute("multiplicity", "1")]
		[UmlTaggedValue("Eco.Embed", "True")]
		#endregion
		public TTServer.Saison Saison
		{
			get
			{
				#region MM_ECO_Generated
				return (TTServer.Saison) (this.eco_Content.get_MemberByIndex(Eco_LoopbackIndices.Saison_MemberIndex));
				#endregion
			}
			set
			{
				#region MM_ECO_Generated
				this.eco_Content.set_MemberByIndex(Eco_LoopbackIndices.Saison_MemberIndex, ((object)(value)));
				#endregion
			}
		}

		#region MM_ECO_Generated
		[UmlElement("AssociationEnd", Index=(Rahmenterminplan.Eco_LoopbackIndices.Spieltag_MemberIndex), Id="{351f4c36-4d5a-4fd5-ae35-4812dd4d9239}")]
		[UmlMetaAttribute("association", typeof(TTServerPackage.RahmenterminplanSpieltag), Index=1)]
		[UmlMetaAttribute("multiplicity", "0..*")]
		[UmlTaggedValue("Eco.Embed", "False")]
		[UmlTaggedValue("Eco.Ordered", "True")]
		#endregion
		public IEcoList<Spieltag> Spieltag
		{
			get
			{
				#region MM_ECO_Generated
				return new ObjectListAdapter<Spieltag>((IList) (this.eco_Content.get_MemberByIndex(Eco_LoopbackIndices.Spieltag_MemberIndex)));
				#endregion
			}
		}

		#region MM_ECO_Generated
		[UmlElement("AssociationEnd", Index=(Rahmenterminplan.Eco_LoopbackIndices.Klasse_MemberIndex), Id="{43b6a4e6-eeaa-4c10-a12d-4d0f0649df3c}")]
		[UmlMetaAttribute("association", typeof(TTServerPackage.KlasseRahmenterminplan), Index=0)]
		[UmlMetaAttribute("multiplicity", "0..*")]
		[UmlTaggedValue("Eco.Embed", "False")]
		#endregion
		public IEcoList<Klasse> Klasse
		{
			get
			{
				#region MM_ECO_Generated
				return new ObjectListAdapter<Klasse>((IList) (this.eco_Content.get_MemberByIndex(Eco_LoopbackIndices.Klasse_MemberIndex)));
				#endregion
			}
		}

		#region MM_ECO_Generated
		#region Attributes
		[UmlElement(Index=(Rahmenterminplan.Eco_LoopbackIndices.Name_MemberIndex), Id="{edd99c02-8330-45bd-b04d-85c2be256423}")]
		[UmlTaggedValue("Eco.Length", "255")]
		#endregion

		#region Documentation
		//1 Name des Rahmenterminplans
		/// Name des Rahmenterminplans
		#endregion

		#endregion
		public string Name
		{
			get
			{
				#region MM_ECO_Generated
				return (string) (this.eco_Content.get_MemberByIndex(Eco_LoopbackIndices.Name_MemberIndex));
				#endregion
			}
			set
			{
				#region MM_ECO_Generated
				this.eco_Content.set_MemberByIndex(Eco_LoopbackIndices.Name_MemberIndex, ((object)(value)));
				#endregion
			}
		}

		#region MM_ECO_Generated
		[UmlElement("AssociationEnd", Index=(Rahmenterminplan.Eco_LoopbackIndices.Wunsch_MemberIndex), Id="{8c3c8e98-291a-43ab-8a71-bd50116f3e39}")]
		[UmlMetaAttribute("association", typeof(TTServerPackage.WunschRahmenterminplan), Index=0)]
		[UmlMetaAttribute("multiplicity", "0..*")]
		[UmlTaggedValue("Eco.Embed", "False")]
		#endregion
		public IEcoList<Wunsch> Wunsch
		{
			get
			{
				#region MM_ECO_Generated
				return new ObjectListAdapter<Wunsch>((IList) (this.eco_Content.get_MemberByIndex(Eco_LoopbackIndices.Wunsch_MemberIndex)));
				#endregion
			}
		}
		#endregion

		#region MM_ECO Model owned methods
		//Note: Do not remove any method within this region, nor change its signature

		public Rahmenterminplan(IContent content)
		{
			#region MM_ECO_Generated
			this.eco_Content = content;
			content.AssertLoopbackUnassigned();
			#endregion
		}

		public Rahmenterminplan(IEcoServiceProvider serviceProvider)
		{
			this.Initialize(serviceProvider);
			try
			{
				// Place user code ONLY here
			}
			catch (System.Exception)
			{
				this.Deinitialize(serviceProvider);
				throw;
			}
		}
		#endregion
	}
}
